<!DOCTYPE html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>支付宝支付列表页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel="stylesheet" type="text/css" href="${contextPath}/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/css/public.css">
<link href="${contextPath}/css/jquery-ui.min.css" rel="stylesheet">
<link href="${contextPath}/css/jquery-ui.theme.min.css" rel="stylesheet">
<style type="text/css">
	.input-group-addon,.form-control{padding:6px;}
	.ui-datepicker .ui-datepicker-title select{color:#1c94c4}
	.form-btn1{height: 50px;float: left;}
</style>
<script type="text/javascript" src="${contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${contextPath}/js/common.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.datepicker-ch.js"></script>
</head>
<body>
	<div class="container" style="max-width: 1366px">
		<div class="panel panel-default" id="alipayInfoList">
			<div class="panel-heading">${model.realName}的支付宝支付信息</div>
			<div class="panel-body">
				<div style="float: right; color: green;">当前页成功支付金额:<span id="pageSalary"></span>元&nbsp;&nbsp;总成功支付金额:<span id="totleSalary"></span>元</div>
				<div style="clear: both;"></div>
			</div>
			<table class="table table-striped table-bordered">
				<thead>
					<tr>
						<th width='4%'>序号</th>
						<th width='10%'>支付宝账号</th>
						<th width='12%'>收款人姓名</th>
						<th width='20%'>订单号</th>
						<th width='15%'>支付时间</th>
						<th width='8%'>金额(元)</th>
						<th width='5%'>状态</th>
						<th width='20%'>错误信息</th>
						<th width='10%'>平台查询码</th>
					</tr>
				</thead>
				<tbody id="alipayInfo-tbody"></tbody>
			</table>
			<ul class="pagination"></ul>
		</div>

	</div>
	<script type="text/javascript">
		var dateType = ${model.dateType };
		var beginDate = "${model.beginDate }";
		var endDate = "${model.endDate }";
		var workerId = "${model.workerId }";
		
		$(document).ready(function(){
			queryAlipayInfos(1);
		});
		
		/*----------------------------------------------用户薪金页----------------------------------------------------------------*/
		queryAlipayInfos = function(pageNum){
			$.ajax({
				type:'POST',
				data:{"workerId":workerId,"beginDate":beginDate,"endDate":endDate,"dateType":dateType,"page":pageNum},
				url:'${contextPath}/security/queryAlipayInfos',
				dataType:'json',
				success:function(data){
					$("#alipayInfo-tbody").empty();			
					if(data.list == ""){
						$("#alipayInfo-tbody").empty();
						$("#alipayInfoList .pageGoBtn").empty();
						$("#alipayInfo-tbody").append("<tr class='text-danger'><td colspan='9'>无内容</td></tr>");
						$("#pageSalary").html(data.pageSalary);
						$("#totleSalary").html(data.totleSalary);
					}else{
						pageTotal = data.totlePage; 
						$("#pageSalary").html(data.pageSalary);
						$("#totleSalary").html(data.totleSalary);
						$.each(data.list,function(i,item){
							var orderIdTD,payDateTD,isSuccessTD,TRcss,subMsgTD = "";
							if(item.orderId == null){
								orderIdTD = "<td>无</td>";
							}else{
								orderIdTD = "<td>"+item.orderId  +"</td>";
							}
				//			if(item.payDate == null){
				//				payDateTD = "<td>无</td>";
				//			}else{
				//				payDateTD = "<td>"+item.payDate+"</td>";
				//			}
							if(item.isSuccess){
								isSuccessTD = "<td>成功</td>";
								subMsgTD = "<td>无</td>";
							}else{
								isSuccessTD = "<td>失败</td>";
								TRcss = "style='color:red;'";
								subMsgTD = "<td>"+item.subMsg+"</td>";
							}
							$("#alipayInfo-tbody").append(
							"<tr "+TRcss+">"+
								"<td>"+(i + 1)+"</td>"+
								"<td>"+item.payeeAccount+"</td>"+
								"<td>"+item.payeeRealName+"</td>"+
								orderIdTD+
					//			payDateTD+
								"<td>"+item.createDate+"</td>"+
								"<td>"+item.amount+"</td>"+ 
								isSuccessTD+
								subMsgTD+
								"<td><a target='_blank' href='${contextPath}/security/queryWorkerRecordByOutBizNo?outBizNo="+item.outBizNo+"'>"+item.outBizNo+"</a></td>"+
							"</tr>"		
							);		
						});
						
						var pageDom = $("#alipayInfoList .pagination");
						pageDom.empty();
						page.creatPageHTML(pageNum,pageTotal,pageDom,"queryAlipayInfos");
						/*--------------------------------------跳转页-------------------------------------------------------*/
						$("#alipayInfoList .pageGoBtn").click(function(){
							var pageNum = 0;
							pageNum = $("#alipayInfoList .pageGoText").val();
							if(pageNum !=0&&0<pageNum&&pageNum<pageTotal+1){
								queryAlipayInfos(pageNum);
							}
						});					
					}
				}
			});
		};
	</script>
</body>
</html>
